//
// Created by hsj on 2022/1/12.
//
#include <iostream>
#include "t_namespace.h"

//命名空间的原型
namespace pers{
    using std::cout;
    using std::cin;
    using std::endl;

    void set_person(person &rp){
        rp.fname = "hsj is smart.";
        rp.lname = "xiao kang.";
    }

    void show_person(const person &rp){
        cout<<"show_person fname:"<<rp.fname<<"show_person lname:"<<rp.lname<<endl;
    }
}
namespace debts{

    void set_debt(debt &rd){
        set_person(rd.name);
        rd.amount = 10000.00;
    }
    void show_debt(const debt &rd){
        using std::cout;
        using std::endl;

        show_person(rd.name);
        cout<<"show_debt amount:"<<rd.amount<<endl;
    }
    double sum_debts(const debt ar[],int n){
        double total = 0;
        for (int i = 0; i < n; ++i) {
            total += ar[i].amount;
        }
        return total;
    }
}
